package com.fansl.allround.upms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fansl.allround.upms.api.entity.SysUserRole;
import org.apache.ibatis.annotations.Param;

/**
 * @author fansl
 * @Description: 用户角色表 Mapper 接口
 * @date 2019/8/13 12:06
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
    /**
     * 根据用户Id删除该用户的角色关系
     *
     * @param userId 用户ID
     * @return boolean
     */
    Boolean deleteByUserId(@Param("userId") Integer userId);

    /**
     * 没有则新增，有则忽略
     *
     * @param sysUserRole
     * @return
     */
    int ignoreSave(@Param("param") SysUserRole sysUserRole);
}
